{% extends "User_panel/base_user_panel.html" %}
{% block panel-content %}
    {% if bought_goods %}
    <div id="center">
        <h3>&nbsp&nbsp&nbsp&nbsp;My Bought Goods({{length}})</h3>
        <div class="goods_categories">
            <font>Category</font>:&nbsp;<a href="/user_panel/goods/bought_goods/all/">All</a>&nbsp;
            {% if bought_goods %}
                |&nbsp;
                {% for bought_good in bought_goods %}
                    <a href="/user_panel/goods/bought_goods/{{bought_good.subcategory.category.name}}/">{{bought_good.subcategory.category.name}}</a>&nbsp&nbsp&nbsp;
                {% endfor %}
            {% endif %}
        </div>
        <table id="bought_goods_list" cellspacing="20">
            <thead>
                <tr align="center">
                    <th>
                        Category
                    </th>
                    <th>
                        Sub Category
                    </th>
                    <th colspan="2">
                        Name
                    </th>
                    <th>
                        Price
                    </th>
                </tr>
            </thead>
            <tbody>
            {%  for bought_good in bought_goods_filter %}
                <tr align="center">
                    <td>
                        {{bought_good.subcategory.category.name}}
                    </td>
                    <td>
                        {{bought_good.subcategory.name}}
                    </td>
                    <td>
                        <img src="/{{ bought_good.image }}" style="max-width:60px; max-height:60px;"/>
                    </td>
                    <td>
                        <a href="/products/{{ bought_good.id}}" style="color:blue">{{bought_good.name}}</a>
                    </td>
                    <td>
                        {{bought_good.price}}
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    {% else %}
        You didn't buy any goods!
    {% endif %}
{% endblock %}